package com.example.mybatis.mapper;

import com.example.mybatis.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository

public interface UserMapper {
    @Select("select * from user;")
    List<User> getUserList();

    @Select("select * from user where id = #{id};")
    User getUserById(@Param("id")Integer id);

    @Delete("delete from user where id = #{id};")
    Integer deleteById(@Param("id") Integer id);
}
